<% if @tree %>
    <div class="col-sm-8">
      <div class="tree">
        <% @tree.each do |platform, dependency_trees| %>
          <h4>
            <div class="pictogram tip pictogram-<%= platform.try(:downcase) %>" title='<%= platform %>'></div>
            <%= platform %>
          </h4>
          <ul class="top-level">
            <% dependency_trees.compact.each do |tree| %>
              <%= render 'dep', dep: tree %>
            <% end %>
          </ul>
        <% end %>
      </div>
    </div>
    <div class="col-sm-4">
      <div>
        <p class="h4">Unique dependencies:</p>
        <p class="h1"><%= @project_names.uniq.length %></p>
        <hr/>
        <p class="h4">Unique licenses:</p>
        <p class="h1"><%= @license_names.flatten.uniq.length %></p>
        <p class="h5"><%= @license_names.flatten.uniq.sort.join(', ') %></p>
      </div>
    </div>
<% else %>
  <div class="col-12">
    <h3 class='text-center'>
      <i class="fa fa-refresh fa-spin"></i>
      Generating dependency tree...
    </h3>
  </div>
  <script type="text/javascript">
    setTimeout(function() {
      $.get(window.location, function(data) {
        $('#tree').html(data);
        stickFooter()
      });
    }, 1000)
  </script>
<% end %>
